home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 November / PCWNOV08.iso / Software / Freeware / NoteTab Light 5.7 / NoteTab_Setup.exe / {app} / Libraries / TopStyle.clb < prev    next >
Encoding:
Text File  |  2008-07-15  |  3.9 KB  |  154 lines

  1. = V5 MultiLine NoSorting TabWidth=30
  2.  
  3. H=";About this library"
  4. This library was written by Fookes Software to serve as a demonstration of the varied tasks that can be performed by the Editor Clipbook. You are free to customize it any way you like!
  5.  
  6. The Clips provided in this library require Bradsoft's TopStyle CSS editor, version 1.51 or above.  For more information about TopStyle, please visit the TopStyle home page at:
  7.  
  8.     http://www.bradsoft.com/topstyle/
  9.  
  10.  
  11. H="; "
  12.  
  13.  
  14. H="TopStyle Home Page"
  15. ^!URL http://www.bradsoft.com/redir.asp?id=130
  16.  
  17. H="Download TopStyle"
  18. ^!URL http://www.bradsoft.com/redir.asp?id=131
  19.  
  20. H="; "
  21.  
  22.  
  23. H="Edit Style Block"
  24. ;Is TopStyle available? Clip ends if not.
  25. ^!Clip "Check TopStyle Enabled"
  26.  
  27. ;Don't select the <style>..</style> tags!
  28. ^!Set %Str%=^$GetSelection$
  29. ^!IfTrue ^$IsEmpty(^%Str%)$ FindTag
  30.  
  31. ^!Set %StyleStart%=^$GetRowStart$:^$GetColStart$
  32. ^!Set %StyleEnd%=^$GetRowEnd$:^$GetColEnd$
  33. ^!Goto CheckCommentTag
  34.  
  35. :FindTag
  36. ^!Find "<style>" TIWS
  37. ^!IfError Next ELSE EndTag
  38. ^!Find "<style" TIWSC
  39. ^!IfError InformError
  40. ^!Find ">" TIS
  41. ^!IfError InformError
  42.  
  43. :EndTag
  44. ^!Jump SELECT_END
  45. ^!Set %StyleStart%=^$GetRow$:^$GetCol$
  46. ^!Find "</style>" TIWS
  47. ^!IfError InformError
  48. ^!Jump SELECT_START
  49. ^!Set %StyleEnd%=^$GetRow$:^$GetCol$
  50. ^!SelectTo ^%StyleStart%
  51.  
  52. :CheckCommentTag
  53. ^!Find "<!--" TIHS
  54. ^!IfError Start
  55. ^!Jump SELECT_END
  56. ^!Set %StyleStart%=^$GetRow$:^$GetCol$
  57. ^!Find "-->" TIS
  58. ^!IfError ^!SetCursor ^%StyleEnd%
  59. ^!Jump SELECT_START
  60. ^!SelectTo ^%StyleStart%
  61.  
  62. :Start
  63. ^!Set %Str%=^$GetSelection$
  64. ;Invoke the TopStyle editor
  65. ^!Set %StrNew%=^$EditStyleBlock(^%Str%)$
  66. ;Check if style values have changed. If not, end procedure
  67. ^!IfSame "^%Str%" "^%StrNew%" End
  68. ;Temporarily turn off automatic indenting (if it is enabled)
  69. ^!SetPasteIndent Off
  70. ^!InsertText ^%StrNew%
  71. ^!Goto End
  72.  
  73. :InformError
  74. ^!Prompt Please select the style block you want to edit
  75.  
  76. H="Edit Style Attribute"
  77. ;Is TopStyle available? Clip ends if not.
  78. ^!Clip "Check TopStyle Enabled"
  79.  
  80. ;Don't select the quote marks!
  81. ^!Set %Str%=^$GetSelection$
  82. ;If no text was selected, retrieve all text between quotes
  83. ^!IfFalse ^$IsEmpty(^%Str%)$ Start
  84. ^!Set %Str%=^$GetQuoteBlock(True)$
  85. ^!IfTrue ^$IsEmpty(^%Str%)$ InformError
  86.  
  87. :Start
  88. ;Invoke the TopStyle editor
  89. ^!Set %StrNew%=^$EditStyleAttr("^%Str%")$
  90. ;Check if attribute values have changed. If not, end procedure
  91. ^!IfSame "^%Str%" "^%StrNew%" End
  92. ;Temporarily turn off automatic indenting (if it is enabled)
  93. ^!SetPasteIndent Off
  94. ;Insert modified attribute
  95. ^!InsertText ^%StrNew%
  96. ^!Goto End
  97.  
  98. :InformError
  99. ^!Prompt Please select the Style attribute you want to edit
  100.  
  101. H="Open <LINK> Style Sheet"
  102. ;Is TopStyle available? Clip ends if not.
  103. ^!Clip "Check TopStyle Enabled"
  104.  
  105. ;Select tag at cursor position
  106. ^!Set %Str%=^$GetHtmlTag(True)$
  107. ;Check if valid LINK tag
  108. ^!If ^$StrPos("link";"^%Str%";No)$ = 0 InformError
  109. ^!If ^$StrPos("stylesheet";"^%Str%";No)$ = 0 InformError
  110. ;Select HREF attribute
  111. ^!Find "href" CIHS
  112. ^!IfError InformError
  113. ^!Jump SELECT_END
  114. ^!MoveCursor +3
  115. ^!Select FileName
  116. ^!Set %Str%=^$GetSelection$
  117. ^!IfTrue ^$IsEmpty(^%Str%)$ InformError
  118.  
  119. ;Invoke the TopStyle editor
  120. ^!EditStyleSheet ^%Str%
  121. ^!IfError ^!Prompt Error: file "^%Str%" not found
  122. ^!Goto End
  123.  
  124. :InformError
  125. ^!Prompt Please select the LINK tag defining the Style Sheet you want to edit
  126.  
  127. H="Edit Style Sheet"
  128. ;Is TopStyle available? Clip ends if not.
  129. ^!Clip "Check TopStyle Enabled"
  130.  
  131. ;Invoke the TopStyle editor
  132. ^!EditStyleSheet ^**
  133.  
  134.  
  135. H="; "
  136.  
  137.  
  138. H="Open TopStyle"
  139. ;Is TopStyle available? Clip ends if not.
  140. ^!Clip "Check TopStyle Enabled"
  141.  
  142. ;Open the TopStyle editor
  143. ^!EditStyleSheet
  144.  
  145.  
  146. H="; "
  147.  
  148.  
  149. H="_Check TopStyle Enabled"
  150. ^!IfTrue ^$IsTopStyleEnabled$ End
  151. ^!Continue This Clip requires Bradsoft's TopStyle CSS editor, version 1.51 or later.  Click OK to visit Bradsoft's web site for more information about TopStyle, or click Cancel to abort.
  152. ^!URL http://www.bradsoft.com/redir.asp?id=130
  153. ^!Goto Exit
  154.